package com.aidex.biz.service.impl;

import java.util.List;
import java.util.Map;

import com.aidex.common.annotation.DataScope;
import com.github.pagehelper.PageInfo;
import com.aidex.common.core.domain.entity.SysUser;
import com.aidex.common.core.domain.entity.SysDept;
import com.aidex.common.core.service.BaseServiceImpl;
import com.aidex.framework.cache.DeptUtils;
import com.aidex.framework.cache.UserUtils;
import org.springframework.stereotype.Service;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.aidex.biz.mapper.CustomerDongtaiMapper;
import com.aidex.biz.domain.CustomerDongtai;
import com.aidex.biz.service.CustomerDongtaiService;
import org.springframework.transaction.annotation.Transactional;
import com.aidex.common.utils.NumberUtils;

/**
 * 客户动态Service业务层处理
 * @author sean
 * @email 2074844820@qq.com
 * @date 2023-12-28
 */
@Service
@Transactional(readOnly = true)
public class CustomerDongtaiServiceImpl extends BaseServiceImpl<CustomerDongtaiMapper, CustomerDongtai> implements CustomerDongtaiService
{
    private static final Logger log = LoggerFactory.getLogger(CustomerDongtaiServiceImpl.class);

    /**
     * 获取单条数据
     * @param customerDongtai 客户动态
     * @return 客户动态
     */
    @Override
    public CustomerDongtai get(CustomerDongtai customerDongtai)
    {
        CustomerDongtai dto = super.get(customerDongtai);
        return dto;
    }

    /**
     * 获取单条数据
     * @param id 客户动态id
     * @return 客户动态
     */
    @Override
    public CustomerDongtai get(String id)
    {
        CustomerDongtai dto = super.get(id);
        return dto;
    }


    /**
     * 查询客户动态列表
     * @param customerDongtai 客户动态
     * @return 客户动态
     */
    @Override
    @DataScope(userAlias = "a",deptAlias = "a")
    public List<CustomerDongtai> findList(CustomerDongtai customerDongtai)
    {
        return super.findList(customerDongtai);
    }

    /**
     * 分页查询客户动态列表
     * @param customerDongtai 客户动态
     * @return 客户动态
     */
    @Override
    @DataScope(userAlias = "a",deptAlias = "a")
    public PageInfo<CustomerDongtai> findPage(CustomerDongtai customerDongtai)
    {
        return super.findPage(customerDongtai);
    }

    /**
     * 保存客户动态
     * @param customerDongtai
     * @return 结果
     */
    @Override
    public boolean save(CustomerDongtai customerDongtai)
    {
        return super.save(customerDongtai);
    }


    /**
     * 删除客户动态信息
     * @param customerDongtai
     * @return 结果
     */
    @Override
    public boolean remove(CustomerDongtai customerDongtai)
    {
        return super.remove(customerDongtai);
    }

    /**
     * 批量删除客户动态
     * @param ids 需要删除的客户动态ID
     * @return 结果
     */
    @Transactional(readOnly = false)
    @Override
    public int deleteCustomerDongtaiByIds(String[] ids)
    {
        return mapper.deleteCustomerDongtaiByIds(ids);
    }

    /**
     * 获取最大编号
     * @param customerDongtai 客户动态
     * @return 结果
     */
    @Override
    public int findMaxSort(CustomerDongtai customerDongtai)
    {
        return NumberUtils.nextOrder(mapper.findMaxSort(customerDongtai));
    }

    @Override
    @Transactional(readOnly = false)
    public Integer insertBatch(Map<String, Object> params) {
        return mapper.insertBatch(params);
    }

}
